{layout name="common/base" }
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-btn-container">
            <button class="layui-btn layui-btn-sm data-add-btn"> 新增结果 </button>
        </div>
        <div class="layui-form" style="margin-top: 20px;">
            <table class="layui-table" style="table-layout: fixed;">
                <colgroup>
                    <col width="50">
                    <col width="200">
                    <col width="150">
                    <col minWidth="200">
                    <col width="100">
                    <col width="100">
                    <col width="200">
                </colgroup>
                <thead>
                <tr>
                    <th>ID</th>
                    <th>订单号</th>
                    <th>用户</th>
                    <th>订单产品</th>
                    <th>价格￥</th>
                    <th>状态</th>
                    <th>创建时间</th>
                </tr>
                </thead>
                <tbody>
                {volist name="list['data']" id="vo"}
                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.order_no}</td>
                    <td>{$vo.user.nickName}</td>
                    <td>{$vo.product.name}</td>
                    <td>{$vo.price}</td>
                    <td>{$vo.status == 1 ? '待支付': '已支付' }</td>
                    <td>{$vo.create_time}</td>
                </tr>
                {/volist}
                </tbody>
            </table>
        </div>
    </div>

    <div id="pages"></div>
</div>
<script src="__PUBLIC__/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>

<script>
    layui.use(['form', 'table'], function () {
        var $ = layui.jquery,
            laypage = layui.laypage;
        laypage.render({ //分页
            elem: 'pages',
            count: '<?php echo $list["total"]; ?>',  // 新加的内容哦。
            theme: '#FFB800',
            //, curr: param['page']
            curr: '<?php echo $list["current_page"]; ?>', // 完美解决哦。
            //,hash: 'page' //自定义hash值
            jump: function(obj, first){
                //obj包含了当前分页的所有参数，比如：
                //首次不执行
                if(!first){
                    //do something
                    location.href="?page="+obj.curr
                }
            }
        });
    });
</script>
